package com.financing.platform.dao.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpFaUserDao;
import com.financing.platform.dto.FpFaUserDTO;
import com.financing.platform.dto.vo.FpFaUserVoDTO;
import com.financing.platform.util.SqlName;
import com.financing.platform.vo.JcsYxtActivityVO;
import com.financing.platform.vo.UserAllSumVO;
import com.financing.platform.vo.UserShopRoleVO;
/**
 * fp_fa_user  
 * FA人员信息表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpFaUserDao")
public class FpFaUserDaoImpl extends BaseDaoImpl implements IFpFaUserDao {


	@Override
	public int insert(FpFaUserDTO fpFaUser) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FpFaUserSql.insert, fpFaUser);
	}

	@Override
	public void update(FpFaUserDTO fpFaUser) throws SQLException {
		this.sqlMapClient.update(SqlName.FpFaUserSql.update, fpFaUser);
	}

	@Override
	public void updateForce(FpFaUserDTO fpFaUser) throws SQLException {
		this.sqlMapClient.update(SqlName.FpFaUserSql.updateForce, fpFaUser);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FpFaUserSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserDTO> queryList(FpFaUserDTO fpFaUser) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryList, fpFaUser);
	}

	@Override
	public int queryListCount(FpFaUserDTO fpFaUser) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.queryListCount, fpFaUser);
	}

	@Override
	public FpFaUserDTO loadById(Integer id) throws SQLException {
		return  (FpFaUserDTO)this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.loadById,id);
	}

	@Override
	public int queryBySfaCount(FpFaUserDTO fpFaUser) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.queryBySfaCount, fpFaUser);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserVoDTO> queryBySfaTimeCount(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryBySfaTimeCount, userDTO);
	}
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserVoDTO> queryByJcsCount(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryByJcsCount, userDTO);
	}
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserVoDTO> queryBySfaNowDayRole1(FpFaUserDTO userDTO) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryBySfaNowDayRole1, userDTO);
	}
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpFaUserDTO> queryListByAuthDate(FpFaUserDTO user) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryListByAuthDate, user);
	}

	@Override
	public FpFaUserDTO queryByMobile(String mobile) throws SQLException {
		// TODO Auto-generated method stub
		return (FpFaUserDTO)this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.queryByMobile,mobile);
	}

	@Override
	public List<JcsYxtActivityVO> queryActivityCount(FpFaUserDTO faUser) throws SQLException {
		// TODO Auto-generated method stub
		return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryActivityCount, faUser);
	}

	@Override
	public int queryAllByAuthDate(FpFaUserDTO user) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.queryAllByAuthDate, user);
	}
@Override
	public int queryUserCount(FpFaUserDTO fpFaUserDTO) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpFaUserSql.queryUserCount, fpFaUserDTO);
	}

@Override
public List<UserShopRoleVO> queryListCountByUshopRole(FpFaUserDTO userDTO) throws SQLException {
	// TODO Auto-generated method stub
	return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryListCountByUshopRole, userDTO);
}

@Override
public List<UserAllSumVO> queryBYAllSum(FpFaUserDTO uDTO) throws SQLException {
	// TODO Auto-generated method stub
	return this.sqlMapClient.queryForList(SqlName.FpFaUserSql.queryBYAllSum, uDTO);
}
	
}